package web.controller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import web.entity.User;
import web.service.LoginService;
import web.utils.ResponseResult;

@RestController
public class LoginController {

    @Autowired
    LoginService loginService;

    @PostMapping("/userlogin")
    public ResponseResult login(@RequestBody User user) {
        return loginService.login(user);
    }

    @PostMapping("/userlogout")
    public ResponseResult logout() {
        return loginService.logout();
    }
}
